package com.job.common.DTO;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * @author songsong
 * @version 1.0
 * @date 2022/12/23 11:00
 **/
@Data
@NoArgsConstructor
public class NodeJobDTO implements Serializable {

    /**
     * Nodes of DAG diagram.
     */
    private List<Node> nodes;
    /**
     * Edges of DAG diagram.
     */
    private List<Edge> edges;

    private int jobFlowId;

    /**
     * Point.
     */
    @Data
    @Accessors(chain = true)
    @NoArgsConstructor
    public static class Node implements Serializable {
        /**
         * node id
         */
        private Integer id;
        /**
         * 描述
         */
        private String jobDesc;
        /**
         * 层级
         */
        private int layer;
        /**
         * 子节点
         */
        private String childJobIds;
        int blockX;
        int blockY;
        public Node(Integer id,String childJobIds){
            this.id=id;
            this.childJobIds = childJobIds;
        }
    }

    /**
     * Edge formed by two node ids.
     */
    @Data
    @NoArgsConstructor
    public static class Edge implements Serializable {

        private Integer from;

        private Integer to;

        public Edge(Integer from, Integer to) {
            this.from = from;
            this.to = to;
        }
    }
}
